import { defineConfig } from 'vite';
import uni from '@dcloudio/vite-plugin-uni';
import autoImport from 'unplugin-auto-import/vite';
import Components from '@uni-helper/vite-plugin-uni-components';
import { WotResolver } from '@uni-helper/vite-plugin-uni-components/resolvers';

import * as path from 'path';

export default defineConfig({
    envDir: 'env',
    resolve: {
        alias: {
            '@': path.join(__dirname, './src'),
        },
    },
    plugins: [
        autoImport({
            imports: ['vue', 'pinia'],
            eslintrc: {
                enabled: true, // Default `false`
                filepath: './.eslintrc-auto-import.json', // Default `./.eslintrc-auto-import.json`
                globalsPropValue: true, // Default `true`, (true | false | 'readonly' | 'readable' | 'writable' | 'writeable')
            },
        }),
        Components({
            resolvers: [WotResolver()],
        }),
        uni(),
    ],
});
